from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By

driver= webdriver.Edge()
driver.get('https://mail.163.com/')
driver.maximize_window()
sleep(2)
# 进入frame框架
# driver.switch_to.frame(driver.find_element(By.XPATH,'/html/body/div[3]/div[3]/div[1]/div/div[3]/div[1]/div[2]/iframe'))
# driver.switch_to.frame(driver.find_element(By.XPATH,'//iframe[starts-with(@id,"x-URS-iframe17")]'))
driver.switch_to.frame(driver.find_element(By.XPATH,'//iframe[contains(@id,"x-URS-iframe17")]'))
# 退出frame框架
driver.switch_to.default_content()
sleep(2)
# 输入账号
driver.find_element(By.NAME,'email').send_keys("18238680385")
sleep(1)
# 输入密码
driver.find_element(By.NAME,'password').send_keys('123456')
sleep(1)
# 点击登录
driver.find_element(By.ID,'dologin').click()

sleep(10)